Apply clippy fixes#148
Conversation
| }; | ||
|
|
||
| if needs_spacing { | ||
| #[allow(clippy::if_same_then_else)] |
There was a problem hiding this comment.
I silenced this warning, because if we collapse all 3 branches into one, the code becomes way less readable:
if is_function
|| (is_inner_class
&& matches!(
previous_token_kind,
Some(TokenKind::Method) | Some(TokenKind::InnerClass),
))
{
output.push_str("\n\n");
} else {
output.push('\n');
}About this lint: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
|
Thank you! What do you think of the unwraps and other warnings suggested in #145 ? If I got it, turning unwraps into expects is just a way to give explicit error messages? |
I think only
Yes, but we can also remove some unwraps completely and handle errors more gracefully. |
|
Thanks, makes sense! |
No description provided.